# Contributor: Galen Abell <galen@galenabell.com>
# Maintainer: Galen Abell <galen@galenabell.com>
pkgname=py3-identify
_pyname=identify
pkgver=2.5.33
pkgrel=0
pkgdesc="File identification library for Python"
url="https://github.com/pre-commit/identify"
arch="noarch"
license="MIT"
depends="py3-ukkonen"
makedepends="py3-gpep517 py3-setuptools py3-wheel"
checkdepends="py3-pytest"
subpackages="$pkgname-pyc"
source="$_pyname-$pkgver.tar.gz::https://github.com/pre-commit/identify/archive/refs/tags/v$pkgver.tar.gz"
builddir="$srcdir/$_pyname-$pkgver"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
cb3cc2064814b6694122040dc1be31f09bbddaf988f15425717d5561f175b216e62f4449cff5d697a8d612a48513e97446973bba42f376cdcfad1d93d1e14cf7  identify-2.5.33.tar.gz
"
